<?php
$user_info = $r->return_result_by_object("tb_users", "where user_num ='{$bbs_uid}'", "*");
$next_level = $user_info->user_level + 1;
$level_info = $r->return_result_by_object("tb_user_level", "where user_level ='{$next_level}'", "need_point");


$remine_point = ($user_info->user_point / $level_info->need_point * 100);
$remine_point_end = 100 - $remine_point;
?>



<div style="text-align: left; font-size: 12px;">
    <div class="f_20 center">회원정보</div> 

    <form id="mod_form">
        <table>
            <tr>
                <td colspan="2">
                    <table class="w_100p" >
                        <tr >
                            <td class=" center bg_silver " >회원번호</td>
                            <td class=" left " ><?= $user_info->user_num; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >I D</td>
                            <td class=" left "  ><?= $user_info->user_id; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >메니저</td>
                            <td class=" left "  ><input type="text" class="w_50" id="is_manager" name="is_manager" value="<?= $user_info->is_manager ?>"></td>
                        </tr>

                        <tr>
                            <td class="center bg_silver ">닉네임</td>
                            <td><input type="text" class="w_200" id="user_nick" name="user_nick" value="<?= $user_info->user_nick ?>"></td>
                        </tr>
                        <tr>
                            <td class="center bg_silver">레벨</td>
                            <td><input type="text" class="w_50" id="user_level" name="user_level" value="<?= $user_info->user_level ?>"></td>
                        </tr>

                        <tr>
                            <td class="center bg_silver">보너스 포인트</td>
                            <td><input type="text" class="w_50" id="" name="" value="">준비중</td>
                        </tr>
                        <tr>
                            <td class="center bg_silver">초인 포인트</td>
                            <td><input type="text" class="w_50" id="" name="" value="">준비중</td>
                        </tr>
                        <tr>
                            <td class="center bg_silver">수컷 포인트</td>
                            <td><input type="text" class="w_50" id="user_point" name="user_point" value="<?= $user_info->user_point ?>"><?= " / " . $level_info->need_point ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >EMAIL</td>
                            <td class=" left "  ><input type="text" class="w_200" id="user_email" name="user_email" value="<?= $user_info->user_email ?>"></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >EMAIL 인증</td>
                            <td class=" left "  ><input type="text" class="w_50" id="auth_email" name="auth_email" value="<?= $user_info->auth_email ?>"></td>
                        </tr>

                        <tr>
                            <td class=" center bg_silver" >벤</td>
                            <td class=" left "  ><input type="text" class="w_50" id="banned" name="banned" value="<?= $user_info->banned ?>"></td>
                        </tr>

                        <tr>
                            <td class=" center bg_silver" >해지일</td>
                            <td class=" left "  ><?= $user_info->ban_expired_date; ?></td>
                        </tr>

                        <tr>
                            <td class="center bg_silver">사망유희</td>
                            <td><?= "승 : " . $user_info->samang_win . " 패 : " . $user_info->samang_lose . " 비김 : " . $user_info->samang_draw; ?></td>
                        </tr>
                        <tr>
                            <td class="center bg_silver">가입일</td>
                            <td><?= $user_info->reg_date ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >추천수</td>
                            <td class=" left "  ><?= $user_info->vote_point; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >비추천수</td>
                            <td class=" left "  ><?= $user_info->deposit_point; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >count_do_agree</td>
                            <td class=" left "  ><?= $user_info->count_do_agree; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >count_do_opposite</td>
                            <td class=" left "  ><?= $user_info->count_do_opposite; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >count_done_agree</td>
                            <td class=" left "  ><?= $user_info->count_done_agree; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >count_done_opposite</td>
                            <td class=" left "  ><?= $user_info->count_done_opposite; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >게시물수</td>
                            <td class=" left "  ><?= $user_info->count_board; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >코멘트수</td>
                            <td class=" left "  ><?= $user_info->count_comment; ?></td>
                        </tr>

                        <tr>
                            <td class=" center bg_silver" >경고</td>
                            <td class=" left "  ><?= $user_info->alert_notice; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >게시물경고</td>
                            <td class=" left "  ><?= $user_info->alert_board; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >코멘트경고</td>
                            <td class=" left "  ><?= $user_info->alert_comment; ?></td>
                        </tr>
                        <tr>
                            <td class=" center bg_silver" >I P</td>
                            <td class=" left "  ><?= $user_info->ip_addr; ?></td>
                        </tr>
                        <tr>
                            <td colspan="100" >
                                <table class="w_250 " style="border:1px solid black; ">
                                    <tr>
                                        <td  class="h_20" width="<?= $remine_point; ?>%" style="border:1px solid blue; background-color: blue;"><div style="position:absolute; color:red; margin-top: -10px;margin-left: 100px; font-size: 20px; "><?= $remine_point; ?>%</div></td>
                                        <td width="<?= round($remine_point_end); ?>%"></td>


                                    </tr>
                                </table>

                            </td>

                    </table>
                </td>
            </tr>
        </table>
    </form>
    <div class="center">
        <input type="button" id="user_mod_button" value="수정" onClick="send_mod_ok();">
    </div>
</div>
<script>

    function send_mod_ok() {
        var mod_form_serialize = $("#mod_form").serialize();
        bbs.swapPage("<?= $PAGE_MOD_OK; ?>" + "&" + mod_form_serialize, "<?= $layer_id; ?>", function () {
            //동기호출로 전환       
            $.ajaxSetup({
                async: true
            });
            bbs.swapPage("<?= $PAGE_LIST; ?>", "<?= $layer_id; ?>");
            bbs.loadMenu('member_info', '<?= "$PAGE_MOD&bbs_uid=$user_info->user_num" ?>', '400', 'auto');
            //비동기호출로 전환
            $.ajaxSetup({
                async: false
            });
        }, "html", "", "<?= $_F->makeToken($SESSION_MOD); ?>");
    }
</script>